//
//  MessageModel.m
//  gushihui
//
//  Created by 甘世清 on 2024/1/25.
//

#import "MessageModel.h"

@implementation MessageModel

- (CGSize)cellSize{
   
    if (_sendType) {
        CGSize size = [Manager SQ_boundingAttributedStringRectWithSize:CGSizeMake(SCREEN_WIDETH-40, MAXFLOAT) lineSpace:2 textFont:FONT_REGULAR(14) string:self.content];
        CGFloat w = size.width + 12;
        CGFloat h = size.height + 12;
        if (w< 20) {
            w = 20;
        }
        if (h < 32) {
            h = 32;
        }
        return CGSizeMake(w, h);
    }else{
        CGSize size =  [Manager SQ_boundingAttributedStringRectWithSize:CGSizeMake(SCREEN_WIDETH-162, MAXFLOAT) lineSpace:2 textFont:FONT_REGULAR(14) string:self.content];
        CGFloat w = size.width + 12;
        CGFloat h = size.height + 12;
        if (w< 24) {
            w = 24;
        }
        if (h < 32) {
            h = 32;
        }
        return CGSizeMake(w, h);
    }
   
}
+(CGSize)SQ_GetSize:(UILabel*)label{
    CGSize size = [Manager SQ_boundingAttributedStringRectWithSize:CGSizeMake(SCREEN_WIDETH-40, MAXFLOAT) lineSpace:2 textFont:FONT_REGULAR(14) string:label.text];
    CGFloat w = size.width + 12;
    CGFloat h = size.height + 12;
    if (w< 20) {
        w = 20;
    }
    if (h < 32) {
        h = 32;
    }
    return CGSizeMake(w, h);
}
 

+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
   return @{@"userid": @"id"};
}
@end
